package com.victor.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 提问表
 * 
 * @author Mr.Zhang
 *
 */
@Entity
@Table(name = "question")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Question {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) // 主键类型--自动递增生成
	@Column(name = "id", unique = true, nullable = false, length = 11)
	private Integer id;

	@Column(name = "userid", length = 50)
	private String userid;// 提问人id

	@Column(name = "q_title", length = 50)
	private String q_title;// 标题

	@Column(name = "q_content", length = 500)
	private String q_content;// 问题详细内容

	@Column(name = "q_reward", length = 11)
	private String q_reward;// 设置悬赏积分

	@Column(name = "q_filepath", length = 50)
	private String q_filepath;// 图片或视频地址

	@Column(name = "q_type", length = 11)
	private String q_type;// 提问类别(0.非匿名提问,1.匿名提问)

	@Column(name = "q_time", length = 50)
	private String q_time;// 提问发布时间
	
	@Column(name = "label_1", length = 50)
	private String label_1;// 标签1
	
	@Column(name = "label_2", length = 50)
	private String label_2;// 标签2
	
	@Column(name = "label_3", length = 50)
	private String label_3;// 标签3
	
	@Column(name = "label_4", length = 50)
	private String label_4;// 标签4
	
	
	@Transient
	private int praise_num;// 点赞数

	@Transient
	private int comment_num;// 评论数

	@Transient
	private List<Answer> answer;// 回答的list

	@Transient
	private YhUsers q_user;// 提问人的用户信息

}
